import { createRouter, createWebHistory } from 'vue-router'
const goods=()=>import('@/views/goods/goods')
const home=()=> import('@/views/home/home')
const mine=()=>import('@/views/mine/mine')
const carts=()=>import('@/views/carts/carts')
const login=()=>import('@/views/login/login')
const routes = [
 {
      path: '/',
      redirect:'/home'
      //默认加载的路由
    },
	 {
	      path: '/home',
	      name: 'home',
	      component: home,
	  },
	  {
	       path: '/mine',
	       name: 'mine',
	       component:mine,
	   },
	   {
	        path: '/carts',
	        name: 'carts',
	        component: carts,
	    },
		{
		     path: '/goods',
		     name: 'goods',
		     component: goods,
		 },
		 {
			 path:'/login',
			 name:'/login',
			 component:login
		 }
	  
];

const router = createRouter({
	history: createWebHistory(process.env.BASE_URL),
	routes
  })

export default router;



